<?php
  include_once($_SERVER['DOCUMENT_ROOT']."/swo.cfg.php");
  require_once("$root_path/lib/dbConnect.php");
  class CommonUtil
  {
  	private $mysqli;
	function __construct() 
	{
	   $dbManager=new DBManager();
	   $this->mysqli=$dbManager->getDBConnection();
    }

    //Return the Data As JSON Object
	public function getOptionValue($tableName,$key,$value)
	  {	  	 
	     $var = "<option value='0'>SELECT</option>";
	     $sql="select $key,$value from ".$tableName." where status=0";
		 $result = $this->mysqli->query($sql);
		 while($row = $result->fetch_array(MYSQLI_ASSOC))
		 {
		   $var .= "<option value='$row[$key]'>$row[$value]</option>";
		 }
         //secho "json Data".$resultJSON;
		 return $var;
	 }
   
  
	 function __destruct() 
	{
	  $this->mysqli->close();
	  //echo "<br />Connection Closed at dbutil<br />";
	}
 }


?>